<template>
	<view>
		<view class="footer-holder"></view>
		<view class="footer">
			<view class="block" v-for="(i,index) in tabbarList" :key="index" @click="goPage(index,i.ulogo)">
				<image :src="tabIndex == index ? getStaticFilePath(i.logo2) : getStaticFilePath(i.logo)" mode="" class="img"></image>
				<view :class="['text',tabIndex == index ? 'text-act2' : '']" >{{ i.name }}</view>
			</view>
		</view>
	</view>
</template>

<script lang="ts" setup>
	import { getStaticFilePath } from '@/utils/luch-request/utils.js';
	const props = defineProps({
		tabIndex:{
			type: [Number],
			default: 0
		},
		tabbarList:{
			type:[Array],
			default: []
		}
	})
	const goPage = (index,url) => {
		if(index == 0){
			return ;
		}else{
			console.log(`当前index:${index},点击的url为:${url}`);
			uni.setStorageSync('JUMPWEBURL',url)
			uni.navigateTo({
				url: '/pages/jump/jump',
			})
		}
	}
</script>

<style lang="scss" scoped>
	.footer-holder{
		width: 100%;
		height: mp-sizing(50);
	}
	.footer{
		position: fixed;
		z-index: 100;
		left: 0;
		bottom: 0;
		width: 100%;
		height: mp-sizing(60);
		display: flex;
		flex-flow: row nowrap;
		justify-content: space-around;
		background-color: $uni-bg-color;
		box-sizing: border-box;
		padding: mp-sizing(10);
		// border-top: mp-sizing(0.5) solid black;
		.block{
			min-width: 20%;
			display: flex;
			flex-flow: column;
			align-items: center;
			justify-content: center;
			.img{
				width: mp-sizing(20);
				height: mp-sizing(20);
			}
			.text{
				margin-top: mp-sizing(5);
				font-size: mp-sizing(12);
			}
			.text-act{
				color: $uni-color-error;
			}
			.text-act2{
				color: $uni-color-primary;
			}
		}
		
	}
</style>